package com.projeto.persistence;

import com.projeto.infra.business.GenericEntity;
import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;

/**
 * The persistent class for the customer database table.
 *
 */
@Entity
public class Customer extends GenericEntity implements Serializable {

    public enum CustomerType {

        SHIPPER("SHIPPER"),
        CONSIGNEE("CONSIGNEE");
        private final String label;

        private CustomerType(String label) {
            this.label = label;
        }

        public String getLabel() {
            return label;
        }
    }
    private static final long serialVersionUID = 1L;
    @Id
    private String id;
    @Column(name = "AIR_RATE", precision = 10, scale = 2)
    private double airRate;
    private String alias;
    private String celular;
    private String city;
    private String cnpjcpf;
    private String comments;
    private String company;
    private String country;
    @Column(precision = 10, scale = 2)
    private double cubic;
    private String email;
    private String fax;
    @Column(name = "FIRST_NAME")
    private String firstName;
    private String ierg;
    @Column(name = "LAST_NAME")
    private String lastName;
    @Column(name = "MIDDLE_INITIAL")
    private String middleInitial;
    @Column(name = "OCEAN_RATE", precision = 10, scale = 2)
    private double oceanRate;
    @Column(name = "PICKUP_RATE", precision = 10, scale = 2)
    private double pickupRate;
    @Column(name = "OTHER_PHONE")
    private String otherPhone;
    private String phone;
    private String state;
    private String street;
    private String suite;
    @Enumerated(EnumType.STRING)
    private CustomerType type;
    private boolean inactive;
    private String zip;
    @Temporal( TemporalType.TIMESTAMP)
    @Column(name = "CREATE_DT")
    private Date createDt;
    @Temporal( TemporalType.TIMESTAMP)
    @Column(name = "UPDATE_DT")
    private Date updateDt;
    //bi-directional many-to-one association to Usertable
    @ManyToOne
    @JoinColumn(name = "CREATED_BY")
    private User createdBy;
    //bi-directional many-to-one association to Usertable
    @ManyToOne
    @JoinColumn(name = "UPDATED_BY")
    private User updatedBy;

    public Customer() {
    }

    @Override
    public String getId() {
        return this.id;
    }

    @Override
    public void setId(String id) {
        this.id = id;
    }

    public double getAirRate() {
        return this.airRate;
    }

    public void setAirRate(double airRate) {
        this.airRate = airRate;
    }

    public String getAlias() {
        return this.alias;
    }

    public void setAlias(String alias) {
        this.alias = alias;
    }

    public String getCelular() {
        return this.celular;
    }

    public void setCelular(String celular) {
        this.celular = celular;
    }

    public String getCity() {
        return this.city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCnpjcpf() {
        return this.cnpjcpf;
    }

    public void setCnpjcpf(String cnpjcpf) {
        this.cnpjcpf = cnpjcpf;
    }

    public String getComments() {
        return this.comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    public String getCompany() {
        return this.company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getCountry() {
        return this.country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public Double getCubic() {
        return this.cubic;
    }

    public void setCubic(Double cubic) {
        this.cubic = cubic;
    }

    public String getEmail() {
        return this.email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getFax() {
        return this.fax;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    public String getFirstName() {
        return this.firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getIerg() {
        return this.ierg;
    }

    public void setIerg(String ierg) {
        this.ierg = ierg;
    }

    public String getLastName() {
        return this.lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getMiddleInitial() {
        return this.middleInitial;
    }

    public void setMiddleInitial(String middleInitial) {
        this.middleInitial = middleInitial;
    }

    public Double getOceanRate() {
        return this.oceanRate;
    }

    public void setOceanRate(Double oceanRate) {
        this.oceanRate = oceanRate;
    }

    public String getOtherPhone() {
        return this.otherPhone;
    }

    public void setOtherPhone(String otherPhone) {
        this.otherPhone = otherPhone;
    }

    public String getPhone() {
        return this.phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getState() {
        return this.state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getStreet() {
        return this.street;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    public String getSuite() {
        return this.suite;
    }

    public void setSuite(String suite) {
        this.suite = suite;
    }

    public CustomerType getType() {
        return this.type;
    }

    public void setType(CustomerType type) {
        this.type = type;
    }

    public String getZip() {
        return this.zip;
    }

    public void setZip(String zip) {
        this.zip = zip;
    }

    public Double getPickupRate() {
        return pickupRate;
    }

    public void setPickupRate(Double pickupRate) {
        this.pickupRate = pickupRate;
    }

    @Override
    public Date getCreateDt() {
        return createDt;
    }

    @Override
    public void setCreateDt(Date createDt) {
        this.createDt = createDt;
    }

    @Override
    public Date getUpdateDt() {
        return updateDt;
    }

    @Override
    public void setUpdateDt(Date updateDt) {
        this.updateDt = updateDt;
    }

    @Override
    public User getCreatedBy() {
        return createdBy;
    }

    @Override
    public void setCreatedBy(User createdBy) {
        this.createdBy = createdBy;
    }

    @Override
    public User getUpdatedBy() {
        return updatedBy;
    }

    @Override
    public void setUpdatedBy(User updatedBy) {
        this.updatedBy = updatedBy;
    }

    public boolean getInactive() {
        return inactive;
    }

    public void setInactive(boolean inactive) {
        this.inactive = inactive;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 23 * hash + (this.id != null ? this.id.hashCode() : 0);
        hash = 23 * hash + (int) (Double.doubleToLongBits(this.airRate) ^ (Double.doubleToLongBits(this.airRate) >>> 32));
        hash = 23 * hash + (this.alias != null ? this.alias.hashCode() : 0);
        hash = 23 * hash + (this.celular != null ? this.celular.hashCode() : 0);
        hash = 23 * hash + (this.city != null ? this.city.hashCode() : 0);
        hash = 23 * hash + (this.cnpjcpf != null ? this.cnpjcpf.hashCode() : 0);
        hash = 23 * hash + (this.comments != null ? this.comments.hashCode() : 0);
        hash = 23 * hash + (this.company != null ? this.company.hashCode() : 0);
        hash = 23 * hash + (this.country != null ? this.country.hashCode() : 0);
        hash = 23 * hash + (int) (Double.doubleToLongBits(this.cubic) ^ (Double.doubleToLongBits(this.cubic) >>> 32));
        hash = 23 * hash + (this.email != null ? this.email.hashCode() : 0);
        hash = 23 * hash + (this.fax != null ? this.fax.hashCode() : 0);
        hash = 23 * hash + (this.firstName != null ? this.firstName.hashCode() : 0);
        hash = 23 * hash + (this.ierg != null ? this.ierg.hashCode() : 0);
        hash = 23 * hash + (this.lastName != null ? this.lastName.hashCode() : 0);
        hash = 23 * hash + (this.middleInitial != null ? this.middleInitial.hashCode() : 0);
        hash = 23 * hash + (int) (Double.doubleToLongBits(this.oceanRate) ^ (Double.doubleToLongBits(this.oceanRate) >>> 32));
        hash = 23 * hash + (int) (Double.doubleToLongBits(this.pickupRate) ^ (Double.doubleToLongBits(this.pickupRate) >>> 32));
        hash = 23 * hash + (this.otherPhone != null ? this.otherPhone.hashCode() : 0);
        hash = 23 * hash + (this.phone != null ? this.phone.hashCode() : 0);
        hash = 23 * hash + (this.state != null ? this.state.hashCode() : 0);
        hash = 23 * hash + (this.street != null ? this.street.hashCode() : 0);
        hash = 23 * hash + (this.suite != null ? this.suite.hashCode() : 0);
        hash = 23 * hash + (this.type != null ? this.type.hashCode() : 0);
        hash = 23 * hash + (this.inactive ? 1 : 0);
        hash = 23 * hash + (this.zip != null ? this.zip.hashCode() : 0);
        hash = 23 * hash + (this.createDt != null ? this.createDt.hashCode() : 0);
        hash = 23 * hash + (this.updateDt != null ? this.updateDt.hashCode() : 0);
        hash = 23 * hash + (this.createdBy != null ? this.createdBy.hashCode() : 0);
        hash = 23 * hash + (this.updatedBy != null ? this.updatedBy.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Customer other = (Customer) obj;
        if ((this.id == null) ? (other.id != null) : !this.id.equals(other.id)) {
            return false;
        }
        if (Double.doubleToLongBits(this.airRate) != Double.doubleToLongBits(other.airRate)) {
            return false;
        }
        if ((this.alias == null) ? (other.alias != null) : !this.alias.equals(other.alias)) {
            return false;
        }
        if ((this.celular == null) ? (other.celular != null) : !this.celular.equals(other.celular)) {
            return false;
        }
        if ((this.city == null) ? (other.city != null) : !this.city.equals(other.city)) {
            return false;
        }
        if ((this.cnpjcpf == null) ? (other.cnpjcpf != null) : !this.cnpjcpf.equals(other.cnpjcpf)) {
            return false;
        }
        if ((this.comments == null) ? (other.comments != null) : !this.comments.equals(other.comments)) {
            return false;
        }
        if ((this.company == null) ? (other.company != null) : !this.company.equals(other.company)) {
            return false;
        }
        if ((this.country == null) ? (other.country != null) : !this.country.equals(other.country)) {
            return false;
        }
        if (Double.doubleToLongBits(this.cubic) != Double.doubleToLongBits(other.cubic)) {
            return false;
        }
        if ((this.email == null) ? (other.email != null) : !this.email.equals(other.email)) {
            return false;
        }
        if ((this.fax == null) ? (other.fax != null) : !this.fax.equals(other.fax)) {
            return false;
        }
        if ((this.firstName == null) ? (other.firstName != null) : !this.firstName.equals(other.firstName)) {
            return false;
        }
        if ((this.ierg == null) ? (other.ierg != null) : !this.ierg.equals(other.ierg)) {
            return false;
        }
        if ((this.lastName == null) ? (other.lastName != null) : !this.lastName.equals(other.lastName)) {
            return false;
        }
        if ((this.middleInitial == null) ? (other.middleInitial != null) : !this.middleInitial.equals(other.middleInitial)) {
            return false;
        }
        if (Double.doubleToLongBits(this.oceanRate) != Double.doubleToLongBits(other.oceanRate)) {
            return false;
        }
        if (Double.doubleToLongBits(this.pickupRate) != Double.doubleToLongBits(other.pickupRate)) {
            return false;
        }
        if ((this.otherPhone == null) ? (other.otherPhone != null) : !this.otherPhone.equals(other.otherPhone)) {
            return false;
        }
        if ((this.phone == null) ? (other.phone != null) : !this.phone.equals(other.phone)) {
            return false;
        }
        if ((this.state == null) ? (other.state != null) : !this.state.equals(other.state)) {
            return false;
        }
        if ((this.street == null) ? (other.street != null) : !this.street.equals(other.street)) {
            return false;
        }
        if ((this.suite == null) ? (other.suite != null) : !this.suite.equals(other.suite)) {
            return false;
        }
        if (this.type != other.type) {
            return false;
        }
        if (this.inactive != other.inactive) {
            return false;
        }
        if ((this.zip == null) ? (other.zip != null) : !this.zip.equals(other.zip)) {
            return false;
        }
        if (this.createDt != other.createDt && (this.createDt == null || !this.createDt.equals(other.createDt))) {
            return false;
        }
        if (this.updateDt != other.updateDt && (this.updateDt == null || !this.updateDt.equals(other.updateDt))) {
            return false;
        }
        if (this.createdBy != other.createdBy && (this.createdBy == null || !this.createdBy.equals(other.createdBy))) {
            return false;
        }
        if (this.updatedBy != other.updatedBy && (this.updatedBy == null || !this.updatedBy.equals(other.updatedBy))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Customer{" + "id=" + id + ", airRate=" + airRate + ", alias=" + alias + ", celular=" + celular + ", city=" + city + ", cnpjcpf=" + cnpjcpf + ", comments=" + comments + ", company=" + company + ", country=" + country + ", cubic=" + cubic + ", email=" + email + ", fax=" + fax + ", firstName=" + firstName + ", ierg=" + ierg + ", lastName=" + lastName + ", middleInitial=" + middleInitial + ", oceanRate=" + oceanRate + ", pickupRate=" + pickupRate + ", otherPhone=" + otherPhone + ", phone=" + phone + ", state=" + state + ", street=" + street + ", suite=" + suite + ", type=" + type + ", inactive=" + inactive + ", zip=" + zip + ", createDt=" + createDt + ", updateDt=" + updateDt + ", createdBy=" + createdBy + ", updatedBy=" + updatedBy + '}';
    }
}